<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Swing SpringLayout</title>
<link href="../../../book.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>Swing SpringLayout</h1>
<p>SpringLayout class that implements an constraint-based layout manager. With 
constraint-based layout, you have independent control over the sizing behavior 
of each of the four sides of a widget. The top, bottom, left, and right sides 
can be independently attached to the sides of the parent container or the sides 
of any sibling widget within the same container using either fixed or relative 
offsets. This proves to be surprisingly powerful and can be used to emulate 
almost any of the other layout managers. The SpringLayout class is very simple 
and only specifies the margins of the container.</p>
<ul>
	<li><b><a href="#MainFeatures">Main Features</a></b></li>
	<li><b><a href="#GraphicalFeedback">Graphical Feedback</a></b></li>
</ul>
    <p></p>
<h2><a name="MainFeatures"></a>Main Features</h2>
<ul>
	<li>Select <b>SpringLayout</b> from the <b>Layouts</b> palette and 
				drop it on a JFrame or JPanel</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_design_view.gif"></p>
</blockquote>
<ul>
				<li>Graphical feedback is provided for all widget size and 
				position operations</li>
            </ul>
          <blockquote>
			<p>
	<img border="0" src="images/sl_indent1.gif">&nbsp;
	<img border="0" src="images/sl_margins3.gif" align="top"></p>
</blockquote>
          <p></p>
            <h2><a name="GraphicalFeedback"></a>Graphical Feedback</h2>
<ul>
	<li>Position and size widgets using SpringLayout constraints</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_position1.gif">&nbsp;
	<img border="0" src="images/sl_size1.gif"></p>
</blockquote>
<ul>
	<li>Align widgets horizontally and vertically</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_alignment7.gif">&nbsp;
	<img border="0" src="images/sl_alignment8.gif"></p>
</blockquote>
<ul>
	<li>Indent widgets intelligently</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_indent1.gif">&nbsp;
	<img border="0" src="images/sl_indent2.gif"></p>
</blockquote>
<ul>
	<li>Align widgets to margins</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_margins1.gif" align="top">&nbsp;
	<img border="0" src="images/sl_margins2.gif" align="top">&nbsp;
	<img border="0" src="images/sl_margins3.gif" align="top"></p>
</blockquote>
<ul>
	<li>Anchor widgets to the left, right or both sides</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_alignment1.gif" align="top">&nbsp;
	<img border="0" src="images/sl_alignment2.gif" align="top">&nbsp;
	<img border="0" src="images/sl_alignment3.gif" align="top"></p>
</blockquote>
<ul>
	<li>Anchor widgets to the top, bottom or both sides</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_alignment4.gif" align="top">&nbsp;
	<img border="0" src="images/sl_alignment5.gif" align="top">&nbsp;
	<img border="0" src="images/sl_alignment6.gif" align="top"></p>
</blockquote>
<ul>
	<li>Set anchors via popup context menus</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/sl_alignment_menu1.gif" align="top">&nbsp;
	<img border="0" src="images/sl_alignment_menu2.gif" align="top"></p>
</blockquote>
<ul>
	<li>Align and center widgets using toolbar</li>
</ul>
<blockquote>
	<p>
	<img border="0" src="images/align_toolbar.gif" align="top"></p>
</blockquote>
</body>
</html>